import {createRouter,createWebHistory} from 'vue-router'
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'
import ArticleCategoryVue from '@/views/article/ArticleCategory.vue'
import ArticleManageVue from '@/views/article/ArticleManage.vue'
import UserInfoVue from '@/views/user/UserInfo.vue'
import UserAvatarVue from '@/views/user/UserAvatar.vue'
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue'
import SysUserManageVue from "@/views/system/SysUserManage.vue";
import SysArticleManageVue from "@/views/system/SysArticleManage.vue";
import SysArticleCategoryManageVue from "@/views/system/SysArticleCategoryManage.vue";

//定义路由关系
const routes=[
    {path:'/login',component:LoginVue},
    {   path:'/',
        component:LayoutVue,
        redirect:'/article/manage',
        children:[
            {path:'/article/category',component:ArticleCategoryVue},
            {path:'/article/manage',component:ArticleManageVue},
            {path:'/user/info',component:UserInfoVue},
            {path:'/user/avatar',component:UserAvatarVue},
            {path:'/user/resetPassword',component:UserResetPasswordVue},
            {path:'/sys/userManage',component:SysUserManageVue},
            {path:'/sys/articleManage',component:SysArticleManageVue},
            {path:'/sys/categoryManage',component:SysArticleCategoryManageVue}
        ]
    }
]
//创建路由器
const router=createRouter({
    history:createWebHistory(),
    routes:routes
})
//导出路由器
export default router